package com.example.demo.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.Map;

@RestController
@RequestMapping("/api/login")
@CrossOrigin
public class LoginController {
//    @Autowired
//    private AdminService adminService;
    @PostMapping("/account")
    public Map<String,Object> index(String userName, String password, String type){
        Map<String,Object> data = new HashMap<>();
//        Admin admin = adminService.findByUsername(userName);
//        if (admin==null){
//            data.put("errorMsg","用户名或者密码错误");
//        }
        data.put("status","ok");
        data.put("type",type);
//        data.put("currentAuthority","admin");
        return data;
    }
}
